package com.ljh.interceptor;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class AdminInterceptor extends AbstractInterceptor {
    public String intercept(ActionInvocation actionInvocation) throws Exception {
        if (ActionContext.getContext().getSession().get("user").equals("admin")){
            return actionInvocation.invoke();
        }
        return null;
    }
}
